#include <stdio.h>

int fact(int n){
    if(n<=0)
        return 1;
    return (n - 1)*((fact(n - 1) + fact(n - 2)));
}

int main(int argc, char *argv[]) {

    int n = 0;
    while (scanf("%d",&n)!=EOF)
    {
        printf("%d\n", fact(n));
    }
    

    return 0;
}